package com.mc.algorithm;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;

public class Soda {
	
	public static void execute(){
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n;
		while((n=sc.nextInt())!=0){
			list.add(n);
		}
		
		Iterator<Integer> iter = list.iterator();
		while(iter.hasNext()){
			int sum = iter.next();
			int count = 0;
			while(sum>1){
				count++;
				sum-=2;
			}
			System.out.println(count);
		}
	}
	public static void main(String[] args) {
		Soda.execute();
	}
}
